home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / zendisk1.zip / LST3-1.ASM < prev    next >
Assembly Source File  |  1990-02-15  |  799b  |  32 lines

  1. ;
  2. ; *** Listing 3-1 ***
  3. ;
  4. ; Times speed of memory access to Enhanced Graphics
  5. ; Adapter graphics mode display memory at A000:0000.
  6. ;
  7.     mov    ax,0010h
  8.     int    10h        ;select hi-res EGA graphics
  9.                 ; mode 10 hex (AH=0 selects
  10.                 ; BIOS set mode function,
  11.                 ; with AL=mode to select)
  12. ;
  13.     mov    ax,0a000h
  14.     mov    ds,ax
  15.     mov    es,ax        ;move to & from same segment
  16.     sub    si,si        ;move to & from same offset
  17.     mov    di,si
  18.     mov    cx,800h        ;move 2K words
  19.     cld
  20.     call    ZTimerOn
  21.     rep    movsw        ;simply read each of the first
  22.                 ; 2K words of the destination segment,
  23.                 ; writing each byte immediately back
  24.                 ; to the same address. No memory
  25.                 ; locations are actually altered; this
  26.                 ; is just to measure memory access
  27.                 ; times
  28.     call    ZTimerOff
  29. ;
  30.     mov    ax,0003h
  31.     int    10h        ;return to text mode
  32.